package cn.ytr.crm.domain;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
public class Employee extends BaseDomain{

    //员工id
    private Long id;

    //员工名称
    private String name;

    //员工密码
    private String password;

    //员工邮箱
    private String email;

    //员工年龄
    private Integer age;

    //是否超级管理员
    private Boolean admin;

    //所属部门 id
    private Long deptId;

    //关联部门-连表查询获得
    private Department dept;

    //关联角色-额外 sql 获得，当查询某条时
    private List<Role> roles;

    //get & set
    public List<Role> getRoles () {
        return roles;
    }

    public Department getDept() {
        return dept;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Boolean getAdmin() {
        return admin;
    }

    public void setAdmin(Boolean admin) {
        this.admin = admin;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long dept_id) {
        this.deptId = dept_id;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", age=" + age +
                ", admin=" + admin +
                ", deptId=" + deptId +
                '}';
    }
}